/**
 * @Name: utils/mod
 * @Author: masaikk
 * @Desc:
 * @Time: 2022/11/9 22:28
 */
#[derive(Debug)]
pub struct Config {
    // pub filenames: Vec<String>,
    is_all: bool,
    is_block: bool,
    is_suffix: bool,
    suffix: String,
    is_r: bool,
}

impl Config {
    pub fn get_config(args: &Vec<String>) -> Config {
        // let my_args = args;
        let mut config = Config {
            // filenames: Vec::new(),
            is_all: false,
            is_block: false,
            is_suffix: false,
            suffix: String::from(""),
            is_r: false,
        };
        if args.contains(&String::from("-A")) || args.contains(&String::from("--all")) {
            config.is_all = true;
        };
        if args.contains(&String::from("-b")) {
            config.is_block = true;
        };
        if args.contains(&String::from("-r")) {
            config.is_r = true;
        }
        for (index, value) in args.iter().enumerate() {
            match value.len() {
                1..=8 => {
                    continue;
                }
                _ => {
                    if value[0..8].eq(&String::from("-suffix=")) {}
                }
            }
        }
        // config.filenames.push(String::from("poem.txt"));

        return config;
    }
}